package thinkingInJava.enumerated;
// 重载常量方法
//: enumerated/OverrideConstantSpecific.java
import static thinkingInJava.YTool.YPrint.*;

public enum OverrideConstantSpecific {
	NUT, BOLT,
	WASHER {
		void f() { print("Overridden method"); }
	};
	void f() { print("default behavior"); }
	public static void main(String[] args) {
		for(OverrideConstantSpecific ocs : values()) {
			printnb(ocs + ": ");
			ocs.f();
		}
	}
} /* Output:
NUT: default behavior
BOLT: default behavior
WASHER: Overridden method
 *///:~
